
/*function GetRequest() {
    var url = location.search; //获取url中含"?"符后的字串
    var theRequest = new Object();
    if (url.indexOf("?") != -1) {
        var str = url.substr(1);
        strs = str.split("&");
        for (var i = 0; i < strs.length; i++) {
            theRequest[strs[i].split("=")[0]] = strs[i].split("=")[1];
        }
    }
    console.log(theRequest)
    return theRequest;
}*/
$(function () {

    alert("加载支付页面中的订单信息");


    var Request = GetRequest();


    $("#orderNum").text(decodeURI(Request.orderNum));
    $("#totalAmount").text(decodeURI(Request.totalAmount));
    $("#commodityName").html(decodeURI(Request["commodityName"]));
    $("#ticketDrawer").html(decodeURI(Request["ticketDrawer"]));
    $("#contactNumber").html(decodeURI(Request["contactNumber"]));
    //配送方式(1、快递配送 2票牛自取 3 现场取票 4电子票)
    if(Request.deliverType=="1"){
        $("#deliverType").text("快递配送");
    }else if(Request.deliverType=="2"){
        $("#deliverType").text("票牛自取");
    }else if(Request.deliverType=="3"){
        $("#deliverType").text("现场取票");
    }else {
        $("#deliverType").text("电子票");
    }



});
/*function GetRequest(name) {
    // 获取参数
    var url = window.location.search;
    // 正则筛选地址栏
    var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
    // 匹配目标参数
    var result = url.substr(1).match(reg);
    //返回参数值
    return result ? decodeURIComponent(result[2]) : null;
}*/
/*function GetRequest(name){
    var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if(r!=null)return  unescape(r[2]); return null;
}*/

function GetRequest() {
    var url = window.location.search; //获取url中"?"符后的字串
    url=url.replace("%-%","?");
    url=url.replace("equals","=");
    var theRequest = new Object();
    if (url.indexOf("?") != -1) {
        var str = url.substr(1);
        strs = str.split("&");
        for(var i = 0; i < strs.length; i ++) {
            //就是这句的问题
            theRequest[strs[i].split("=")[0]]=decodeURI(strs[i].split("=")[1]);
        }
    }
    return theRequest;
}

